﻿using AutoChess;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoChessRewardsTitleCell : MonoBehaviour
{
    public GroupSpriteKit sensonTitle,spaecialTitle;
    public Text rankName;
    public GameObject curMask;
    public void Init(Table.DataModel.TableAutoChessSeasionTitle table)
    {
        sensonTitle.SetSpriteName(table.titleIcon);
        if (!string.IsNullOrEmpty(table.specialTitleIcon))
        {
            spaecialTitle.SetSpriteName(table.specialTitleIcon);
        }

        rankName.text = table.titleRank;
        var curRank = AutoChessManager.Ins.cacheData.Rank;
        //bool iscur = curRank >= table.titleRankStart && curRank <= table.titleRankEnd;
        curMask.SetActive(false);
        rankName.gameObject.SetActive(table.isSpecialTitle==0);
        spaecialTitle.gameObject.SetActive(table.isSpecialTitle==1);
    }
}
